import React from "react";

class ClazzCreateRefGetDom extends React.Component{


    constructor(props){
        super(props);
        this.divRef = React.createRef();
    }


    render(){
        return <>
        <div ref={this.divRef}>hello world</div>
        </>
    }

    componentDidMount(){
        //第一次渲染完毕，virtualDOM已经转换为真实DOM此时可以获取DOM元素
        console.log(this.divRef.current);
    }
}

export default ClazzCreateRefGetDom;